package com.gitee.wsl.ext.db

import androidx.room.Room
import androidx.room.RoomDatabase
import kotlinx.cinterop.ExperimentalForeignApi
import platform.Foundation.NSDocumentDirectory
import platform.Foundation.NSFileManager
import platform.Foundation.NSUserDomainMask

//actual inline fun <reified T : RoomDatabase> roomDatabaseBuilder(
//    name: String,
//    isMultiInstance: Boolean,
//): RoomDatabase.Builder<T> {
//   val dbFilePath = documentDirectory() + name
//   return Room.databaseBuilder<T>(name = dbFilePath,)
//}

//@OptIn(ExperimentalForeignApi::class)
//fun documentDirectory(): String {
//    val documentDirectory = NSFileManager.defaultManager.URLForDirectory(
//        directory = NSDocumentDirectory,
//        inDomain = NSUserDomainMask,
//        appropriateForURL = null,
//        create = false,
//        error = null,
//    )
//    return requireNotNull(documentDirectory?.path)
//}
